package org.eclipseuseradmin.internal.ui.editors;

import org.eclipse.ui.PartInitException;
import org.eclipseuseradmin.internal.ui.UserAdminUiPlugin;
import org.eclipseuseradmin.ui.IUser;
import org.eclipseuseradmin.ui.editors.BaseRoleElementEditor;
import org.eclipseuseradmin.ui.editors.UserOverviewPage;
import org.eclipseuseradmin.ui.model.RoleElementModel;
import org.eclipseuseradmin.ui.model.UserModel;

public class UserEditor extends BaseRoleElementEditor {

	@Override
	protected void addPages() {

		try {
			addPage(new UserOverviewPage(this));
		} catch (PartInitException e) {
			UserAdminUiPlugin.log(e);
		}
	}

	public RoleElementModel getModel() {
		if (model == null) {
			model = new UserModel(getUserAdmin(), (IUser) getRoleElementInput()
					.getRoleElement());
		}
		return model;
	}
}
